﻿using PetaPoco;
using System;
using System.ComponentModel.DataAnnotations;

namespace Cxuu.Models;

[TableName("cxuu_article_statement")]
[PrimaryKey("Id", AutoIncrement = true)]
public class ArticleStatement
{
    /// <summary>
    /// ID
    /// </summary>
    public int Id { get; set; }
    /// <summary>
    /// 类别
    /// </summary>
    public int Cid { get; set; }
    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; }
    /// <summary>
    /// 附件
    /// </summary>
    public string Attments { get; set; }
    /// <summary>
    /// 用户ID
    /// </summary>
    public int Uid { get; set; }

    /// <summary>
    /// 图片
    /// </summary>
    public string Img { get; set; }
    /// <summary>
    /// 信息报送时间
    /// </summary>
    public DateTime GreatTime { get; set; }
    /// <summary>
    /// 写入系统时间
    /// </summary>
    public DateTime InsertTime { get; set; } = DateTime.Now;
    /// <summary>
    /// 文号
    /// </summary>
    public string ObjectId1 { get; set; }

    /// <summary>
    /// 来文部门
    /// </summary>
    public string ObjectId2 { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    public string Remarks { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    public string Clercator { get; set; }
}

public class ViewArticleStatementAndCate
{
    public int Id { get; set; }
    public int Cid { get; set; }
    public string Title { get; set; }
    public string CateName { get; set; }
    public string DeptName { get; set; }
    public string Nickname { get; set; }
    /// <summary>
    /// 图片
    /// </summary>
    public string Img{ get; set; }
    /// <summary>
    /// 写入系统时间
    /// </summary>
    public DateTime InsertTime { get; set; }
    /// <summary>
    /// 文号
    /// </summary>
    public string ObjectId1 { get; set; }
    /// <summary>
    /// 报送部门
    /// </summary>
    public string ObjectId2 { get; set; }
    /// <summary>
    /// 经办人
    /// </summary>
    public string Clercator { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string Remarks { get; set; }

}


public class EditArticleStatement
{
    public int Id { get; set; }
    [Display(Name = "类别")]
    public int Cid { get; set; }
    [Display(Name = "工作内容")]
    [Required(ErrorMessage = "工作内容未填写")]
    public string Title { get; set; }
    public string Attments { get; set; }
    public DateTime InsertTime { get; set; } = DateTime.Now;
    [Display(Name = "图片")]
    public string Img { get; set; }

    [Display(Name = "对象标识1")]
    public string ObjectId1 { get; set; }
    [Display(Name = "对象标识2")]
    public string ObjectId2 { get; set; }
    [Display(Name = "经办人")]
    public string Clercator { get; set; }

    [Display(Name = "备注")]
    public string Remarks { get; set; }
    public string CateName { get; set; }
    public string Nickname { get; set; }
    public string Groupname { get; set; }
}


/// <summary>
/// 查询模型
/// </summary>
public class ArticleStatementQuery : Page<ViewArticleStatementAndCate>
{
    public string Cid { get; set; }
    public string SearchCid { get; set; }
    public string NickName { get; set; }
    public int Limit { get; set; } = 15;
    public string Orderby { get; set; }
    public int Uid { get; set; }
    public string Title { get; set; }
    public string Clercator { get; set; }
    public string Uids { get; set; }
    public DateTime? StartDate { get; set; }
    public DateTime? EndDate { get; set; }
}


